<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>漂亮的表单</title>
		<link rel="stylesheet" href="css/style_1.css" media="all" />
		
		<script type="text/javascript">
			
			function onLoad(){
				if(typeof(Storage) == "undefined"){
					alert("业界毒瘤 奏开~");
				}else{
					tijiao.addEventListener("click",saveData);
				}
				
			}
			
			function saveData(){
				localStorage.name = document.getElementById("input_name").value;
				
				loadFromLocalStorage();
			}
			
			//读取函数
			function loadFromLocalStorage(){
				alert("你的名字"+localStorage.name);
			}
			
		</script>
		
		
	</head>

	<body>
		<div>

			<form id="contact" action="" onsubmit="saveData()">
				<h3>表单</h3>
				<h4>这是一个表单练习</h4>
				<fieldset id="">
					<input type="text" name="" id="input_name" value="" placeholder="你的名字" />
				</fieldset>

				<fieldset id="">
					<input type="email" name="" id="input_email" value="" placeholder="你的email" />
				</fieldset>
				<fieldset id="">
					<input type="tel" name="" id="" value="" placeholder="手机号码" />
				</fieldset>
				<fieldset id="">
					<input type="url" name="" id="" value="" placeholder="你的主页地址" />
				</fieldset>
				<fieldset id="">
					<textarea tabindex="5" placeholder="自我介绍"></textarea>
				</fieldset>
				<fieldset id="">
					<button id="tijiao" name="submit" type="submit">提交</button>
				</fieldset>
			</form>
		</div>
		
		<div id="show_LocalStorage">
			
		</div>
	</body>

</html>